package com.qn.analyze.controlle;

import cn.dev33.satoken.annotation.SaCheckLogin;
import cn.dev33.satoken.annotation.SaIgnore;
import com.qn.analyze.entity.AccessRecords;
import com.qn.analyze.entity.IpAddressRecord;
import com.qn.analyze.entity.UserAgentRecord;
import com.qn.analyze.entity.UserLanguageRecord;
import com.qn.analyze.service.AccessRecordsService;
import com.qn.analyze.vo.AccessRecordsQueryVo;
import com.qn.analyze.vo.IpAddressRecordQueryVo;
import com.qn.analyze.vo.UserAgentRecordQueryVo;
import com.qn.analyze.vo.UserLanguageRecordQueryVo;
import com.qn.common.base.BaseControlle;
import com.qn.common.base.model.RequestPage;
import com.qn.common.base.model.ResponseData;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * qingniu-cloud user source analysis
 *
 * @Author: TXG
 * @Date: 2024/6/11
 * @Version V0.0.2
 */
@Tag(name = "系统-访问记录")
@SaCheckLogin
@RestController
@RequestMapping("access/records")
public class AccessRecordsController extends BaseControlle {
    @DubboReference(version = "1.0.0")
    private AccessRecordsService service;
    @Operation(summary ="访客明细")
    @PostMapping("getAccessPageList")
    @SaIgnore
    public ResponseData<List<AccessRecords>> getAccessPageList(@RequestBody RequestPage<AccessRecordsQueryVo> rpage){
        return successD(service.getAccessPageList(rpage));
    }
    @Operation(summary ="IP明细")
    @PostMapping("getIpAddressrPageList")
    @SaIgnore
    public ResponseData<List<IpAddressRecord>> getIpAddressrPageList(@RequestBody RequestPage<IpAddressRecordQueryVo> rpage){
        return successD(service.getIpAddressrPageList(rpage));
    }
    @Operation(summary ="UA明细")
    @PostMapping("getUserAgentPageList")
    @SaIgnore
    public ResponseData<List<UserAgentRecord>> getUserAgentPageList(@RequestBody RequestPage<UserAgentRecordQueryVo> rpage){
        return successD(service.getUserAgentPageList(rpage));
    }
    @Operation(summary ="客户端语言明细")
    @PostMapping("getLanguagePageList")
    @SaIgnore
    public ResponseData<List<UserLanguageRecord>> getLanguagePageList(@RequestBody RequestPage<UserLanguageRecordQueryVo> rpage){
        return successD(service.getLanguagePageList(rpage));
    }
}